using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace PeoplesJukebox.Core.Configuration
{
    /// <summary>
    /// Configuration settings for a tracklist
    /// </summary>
    public class TrackList : ConfigurationElement
    {
        /// <summary>
        /// Gets/sets the tracklist type
        /// </summary>
        [ConfigurationProperty(TrackList.SettingName.Type)]
        public string Type
        {
            get { return (string)this[SettingName.Type]; }
            set { this[SettingName.Type] = value; }
        }

        /// <summary>
        /// Gets/sets the tracklist priority
        /// </summary>
        [ConfigurationProperty(TrackList.SettingName.Priority)]
        public int Priority 
        {
            get { return (int)this[SettingName.Priority]; }
            set { this[SettingName.Priority] = value; }
        }

        /// <summary>
        /// Gets/sets the "chosen by" text for the tracklist
        /// </summary>
        [ConfigurationProperty(TrackList.SettingName.ChosenByText, IsRequired=false, DefaultValue="The People's Jukebox")]
        public string ChosenByText
        {
            get { return (string)this[SettingName.ChosenByText]; }
            set { this[SettingName.ChosenByText] = value; }
        }

        /// <summary>
        /// Constants for indexing settings
        /// </summary>
        private struct SettingName
        {
            public const string Type = "type";
            public const string Priority = "priority";
            public const string ChosenByText = "chosenByText";
        }
    }
}
